﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Media;
using System.Text;
using WaveFramework;

namespace SpeechSynthesizer
{
    public class YPlayer
    {
        //private const string directory = @"d:\Projects\C#\speech-synthesizer\ speech-synthesizer\SpeechSynthesizer\Result\out.wav";
        private static readonly string directory = Directory.GetCurrentDirectory()+"\\Result\\out.wav";

        public static void Play(List<string> pathToFile)
        {
            WaveIO.Concatenate(directory, pathToFile);

            var bytes = File.ReadAllBytes(directory);
            Stream stream = new MemoryStream(bytes);

            SoundPlayer player = new SoundPlayer(stream);
            player.Play();
        }
    }
}
